package com.lvt.design.pattern.struct.adapte;

/**
 * desc： 对象适配器：基于组合
 *
 * @author LT
 * @date 2022/12/3
 */
public class ObjectAdaptor implements ITarget {
    private Adaptee adaptee;

    public ObjectAdaptor(Adaptee adaptee) {
        this.adaptee = adaptee;
    }

    @Override
    public void f1() {
        adaptee.fa(); //委托给Adaptee
    }

    @Override
    public void f2() {
        //...重新实现f2()...
    }

    @Override
    public void fc() {
        adaptee.fc();
    }
}
